home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / asywiz / asmwiz.doc < prev    next >
Text File  |  1994-11-03  |  45KB  |  1,196 lines

  1.                 The Assembly Wizard's Library            page 1
  2.                           Version 2.0
  3.  
  4.      AsmWiz  Copyright (c) 1990-1994  Thomas G. Hanlin III
  5.  
  6.  
  7.  
  8. This is AsmWiz, a library of assembly language routines for
  9. assembly language programmers. It is copyrighted and may be
  10. distributed only under the following conditions:
  11.  
  12.    All AsmWiz files must be distributed together as a unit in
  13.    unmodified form. No files may be left out or added.
  14.  
  15. YOU USE THIS LIBRARY AT YOUR OWN RISK. I have tested it on my
  16. own computer, but I will not assume responsibility for any
  17. problems which AsmWiz may cause you.
  18.  
  19. It is expected that if you find AsmWiz useful, you will register
  20. your copy. You may not use AsmWiz routines in programs intended
  21. for distribution unless you have registered.
  22.  
  23. Registration gets you the latest version of AsmWiz, complete
  24. with full source code. The source code is designed for the MASM
  25. 6.0 and may require modifications to work with other assemblers.
  26.  
  27. The AsmWiz library was designed for use with small assembly
  28. programs and is compatible with the creation of COM files. All
  29. CALLs are of the NEAR variety. A FAR model will be created if
  30. there is sufficient interest.
  31.  
  32. For an example of how to set up your program to access the
  33. AsmWiz library, how to LINK the routines, and so forth, see the
  34. EXAMPLE.ASM, EXAMPLE.COM, and ?CREATE.BAT files. The file
  35. PACKING.LST tells you which ?CREATE batch file to use with which
  36. assembler. There are versions for A86, MASM, OPTASM, QuickASM,
  37. and TASM.
  38.  
  39. Note that DOS-dependent services expect DOS 2.0 or higher
  40. versions unless otherwise specified.
  41.  
  42.                        Table of Contents                 page 2
  43.  
  44.  
  45.  
  46.  Overview and Legal Info ................................... 1
  47.  
  48.  Base Conversions .......................................... 3
  49.  
  50.  Exception Handling ........................................ 4
  51.  
  52.  Delays and Countdowns ..................................... 5
  53.  
  54.  File Handling ............................................. 6
  55.  
  56.  Filename Manipulation ..................................... 8
  57.  
  58.  Keyboard Services ......................................... 9
  59.  
  60.  Long Integer Math ........................................ 10
  61.  
  62.  Memory Services .......................................... 11
  63.  
  64.  Mouse Services ........................................... 12
  65.  
  66.  Sound and Music .......................................... 13
  67.  
  68.  String Services .......................................... 14
  69.  
  70.  Telecommunications ....................................... 16
  71.  
  72.  Time and Date ............................................ 17
  73.  
  74.  Video Services ........................................... 18
  75.  
  76.  Miscellaneous Services ................................... 27
  77.  
  78.  Error Codes .............................................. 28
  79.  
  80.                        Base Conversions                  page 3
  81.  
  82.  
  83.  
  84. The Base Conversion Services provide the ability to convert back
  85. and forth between a number and its ASCIIZ representation. Any
  86. base from 2-36 may be employed, so these routines encompass
  87. binary, decimal, hex and octal conversions. Services are
  88. provided for integers and long integers, both signed and
  89. unsigned.
  90.  
  91.  
  92. The following services are available:
  93.  
  94.    BC_ASC2INT    convert ASCIIZ string to unsigned integer
  95.                        BL <-- base from which to convert
  96.                     DS:SI <-- ptr to string
  97.                     -------
  98.                        AX = unsigned integer
  99.  
  100.    BC_ASC2LONG   convert ASCIIZ string to unsigned long int
  101.                        BL <-- base from which to convert
  102.                     DS:SI <-- ptr to string
  103.                     -------
  104.                     DX,AX = unsigned long integer
  105.  
  106.    BC_ASC2SINT   convert ASCIIZ string to signed integer
  107.                        BL <-- base from which to convert
  108.                     DS:SI <-- ptr to string
  109.                     -------
  110.                        AX = signed integer
  111.  
  112.    BC_ASC2SLONG  convert ASCIIZ string to signed long integer
  113.                        BL <-- base from which to convert
  114.                     DS:SI <-- ptr to string
  115.                     -------
  116.                     DX,AX = signed long integer
  117.  
  118.    BC_INT2ASC    convert unsigned integer to ASCIIZ string
  119.                        AX <-- unsigned integer
  120.                        BL <-- base to which to convert
  121.                     ES:DI <-- ptr to string buffer (17 bytes)
  122.  
  123.    BC_LONG2ASC   convert unsigned long int to ASCIIZ string
  124.                     DX,AX <-- unsigned long integer
  125.                        BL <-- base to which to convert
  126.                     ES:DI <-- ptr to string buffer (33 bytes)
  127.  
  128.    BC_SINT2ASC   convert signed integer to ASCIIZ string
  129.                        AX <-- signed integer
  130.                        BL <-- base to which to convert
  131.                     ES:DI <-- ptr to string buffer (18 bytes)
  132.  
  133.    BC_SLONG2ASC  convert signed long integer to ASCIIZ string
  134.                     DX,AX <-- signed long integer
  135.                        BL <-- base to which to convert
  136.                     ES:DI <-- ptr to string buffer (34 bytes)
  137.  
  138.                       Exception Handling                 page 4
  139.  
  140.  
  141.  
  142. The Exception Handling Services allow your program to take
  143. control over exception conditions. This covers critical errors
  144. and Control-Break / Control-C handling.
  145.  
  146. The critical error handler gives you the ability to recover from
  147. critical errors, which would otherwise cause the infamous
  148. "R>etry, I>gnore, F>ail, A>bort?" prompt.
  149.  
  150. The break handler allows your program to ignore the Control-C
  151. and Control-Break keys or to process them in an orderly manner.
  152. This is vital if you are using any of the AsmWiz services which
  153. need to be shut down before the program terminates. Up to eight
  154. procedures can be called when ^Break or ^C are used (they will
  155. be ignored if you turn off ^Break / ^C).
  156.  
  157.  
  158. The following services are available:
  159.  
  160.  
  161.    EH_INITCRIT   initialize the critical error handler
  162.  
  163.    EH_CRITERR    check for a critical error
  164.  
  165.    EH_CRITDONE   terminates the critical error handler
  166.  
  167.    EH_INITBREAK  initialize the ^C / ^Break handler
  168.  
  169.    EH_ADDBREAK   add a procedure to be called on ^C / ^Break
  170.                        DX <-- procedure offset (CS-relative)
  171.  
  172.    EH_SETBREAK   allow or ignore ^C and ^Break
  173.                        AL <-- 0 to ignore, 1 to allow
  174.  
  175.    EH_SUBBREAK   remove a procedure to be called on ^C / ^Break
  176.                        DX <-- procedure offset (CS-relative)
  177.  
  178.                      Delays and Countdowns               page 5
  179.  
  180.  
  181.  
  182. The Delay Services are for those times when you want the
  183. computer to sit around doing nothing for a while. Delays of
  184. various timing resolution are available for anything from small
  185. to large waits.
  186.  
  187. Notes on the 100th-second delay and countdown services:
  188.  
  189. Since MD_DONE must be called before the program terminates, you
  190. should use the EH_ADDBREAK service to insure that MD_DONE is
  191. called if Control-Break or Control-C are permitted to abort the
  192. program.
  193.  
  194. Timers 0-1 may be used by AsmWiz itself for various services.
  195.  
  196. See ASMWIZ.MAN for more details on the 100th-second delay
  197. services.
  198.  
  199.  
  200. The following services are available:
  201.  
  202.  
  203.    MD_DELAY      delay for a number of 100ths of seconds
  204.                        CX <-- delay (0-32767)
  205.  
  206.    MD_DONE       terminate 100th-second delay handler
  207.  
  208.    MD_GETTIMER   get a delay count
  209.                        AL <-- timer number (0-7)
  210.                     -------
  211.                        CX = delay * 2 (0-65534)
  212.  
  213.    MD_INIT       initialize 100th-second delay handler
  214.  
  215.    MD_SETTIMER   set a delay count
  216.                        AL <-- timer number (0-7)
  217.                        CX <-- delay (0-32767)
  218.  
  219.    MD_TICK       delay for a number of clock ticks (18ths of seconds)
  220.                        CX <-- delay (0-65535)
  221.  
  222.                         File Handling                    page 6
  223.  
  224.  
  225.  
  226. The File Handling Services provide a comprehensive and powerful
  227. set of routines for file handling. The usual open file,
  228. read/write, file pointer manipulation, and close file operations
  229.